package com.youan.pangu.core.mvc.configuration;

import com.youan.pangu.base.bean.ApplicationContextHelper;
import com.youan.pangu.base.bean.SystemParameter;
import com.youan.pangu.core.mvc.listener.ApplicationStartedListener;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 基本的Spring容器配置
 * @author: 辛晟昊
 * @time: 2020/3/8 10:24
 */
@Configuration
public class BaseSpringConfiguration {

    /**
     * 容器帮助类，
     * @return
     */
    @Bean
    public ApplicationContextHelper applicationContextHelper(){
        return new ApplicationContextHelper();
    }

    /**
     * 系统参数实体类
     * @return
     */
    @Bean
    public SystemParameter systemParameter(){
        return new SystemParameter();
    }

    /**
     * 系统启动监听器,主要用于参数加载
     * @return
     */
    @Bean
    public ApplicationStartedListener applicationStartedListener(){
        return new ApplicationStartedListener();
    }
}
